Markdown does not provide cell merge syntax. In our actual application, the arrangement of the table is not consistent, there is a merger of cells.
Although Markdown does not have the syntax for merging cells, Markdown is compatible with HTML. Therefore, we can merge cells through HTML.
Usage: directly paste the written code into the Markdown editor.
Merge cells (two important attributes)
- Inter-row merge: rowspan
- Merging across columns: colspan
The idea of merging cells:
When you merge multiple content, there will be extra things, delete it.
The order of merging is first up, first left
Example of inter-row merging:
<table>
<tr>
<th>属性</th>
<th>属性值</th>
<th>描述</th>
</tr >
<tr >
<td rowspan="9">type</td>
<td>text</td>
<td>单行文本输入框</td>
</tr>
<tr>
<td>password</td>
<td>密码输入框</td>
</tr>
<tr>
<td>radio</td>
<td>单选按钮</td>
</tr>
<tr>
<td>CheckBox</td>
<td>复选按钮</td>
</tr>
<tr><td>button</td>
<td>普通按钮</td>
</tr>
<tr>
<td>submit</td>
<td>提交按钮</td>
</tr>
<tr>
<td>reset</td>
<td>重置按钮</td>
</tr>
<tr>
<td>image</td>
<td>图像形式的提交按钮</td>
</tr>
<tr>
<td >file</td>
<td>文件域</td>
</tr>
<tr>
<td >name</td>
<td>用户自定义</td>
<td>控件名称</td>
</tr>
<tr>
<td >value</td>
<td >用户自定义</td>
<td >默认文本值</td>
</tr>
<tr>
<td >size</td>
<td >正整数</td>
<td >控件在页面中的显示宽度</td>
</tr>
<tr>
<td >checked</td>
<td >checked</td>
<td >定义选择控件默认被选中项</td>
</tr>
<tr>
<td >maxlength</td>
<td >正整数</td>
<td >控件允许输入的最多字符</td>
</tr>
</table>
Attributes | Attribute value | description |
---|---|---|
type | text | Single line text input box |
password | Password input box | |
radio | single button | |
CheckBox | Check button | |
button | Normal button | |
submit | Submit button | |
reset | Reset button | |
image | Submit button in image form | |
file | File domain | |
name | Custom | Control name |
value | Custom | Default text value |
size | Positive integer | The display width of the control on the page |
checked | checked | Define the default selected item of the select control |
maxlength | Positive integer | Maximum characters allowed by the control |
Example of cross-row and cross-column:
<table>
<tr>
<th>属性</th>
<th>属性值</th>
<th>描述</th>
</tr >
<tr >
<td colspan="2" rowspan="2">type</td>
<td>单行文本输入框</td>
</tr>
<tr>
<td>控件名称</td>
</tr>
<tr>
<td >value</td>
<td >用户自定义</td>
<td >默认文本值</td>
</tr>
<tr>
<td >size</td>
<td >正整数</td>
<td >控件在页面中的显示宽度</td>
</tr>
<tr>
<td >checked</td>
<td >checked</td>
<td >定义选择控件默认被选中项</td>
</tr>
<tr>
<td >maxlength</td>
<td >正整数</td>
<td >控件允许输入的最多字符</td>
</tr>
</table>
effect:
Attributes | Attribute value | description |
---|---|---|
type | Single line text input box | |
Control name | ||
value | Custom | Default text value |
size | Positive integer | The display width of the control on the page |
checked | checked | Define the default selected item of the select control |
maxlength | Positive integer | Maximum characters allowed by the control |