【发布时间】:2017-07-27 12:50:39
【问题描述】:
请有人可以帮助我完成这项任务。我想将表格行中的文本居中(“这里有一些文本......”),以便它始终位于屏幕可见区域的中间。表格将水平滚动。
.compare-content {
max-width: 480px;
overflow-x: auto;
}
.compare-content table {
width: 100%;
text-align: center;
font-size: 12px;
}
.compare-content table caption {
font-size: 14px;
line-height: 39px;
border-top: 1px solid #CECECE;
border-bottom: 1px solid #CECECE;
}
.compare-content table tr {
line-height: 25px;
}
.compare-content table td {
padding: 0 10px;
min-width: 145px;
}
.compare-content tr:nth-child(odd) {
background-color: #F4F4F4;
color: #898989;
}
<div class="compare-content">
<table class="total">
<caption>Summary</caption>
<tr>
<td colspan="100%">Some text here...</td>
</tr>
<tr>
<td></td>
<td>text1</td>
<td>text2</td>
<td>text3</td>
</tr>
<tr>
<td colspan="100%">Some text here...</td>
</tr>
<tr>
<td></td>
<td>text4</td>
<td>text5</td>
<td>text6</td>
</tr>
<tr>
<td colspan="100%">Some text here...</td>
</tr>
<tr>
<td></td>
<td>text7</td>
<td>text8</td>
<td>text9</td>
</tr>
<tr>
<td colspan="100%">Some text here...</td>
</tr>
<tr>
<td></td>
<td>text10</td>
<td>text11</td>
<td>text12</td>
</tr>
</table>
<div>
【问题讨论】:
标签: jquery html css html-table row