如何自动将这些文本对齐

时间:2020-04-17 01:25:01

标签: html css

是否可以使这些文本彼此自动对齐?

我想将粉红色的单词与 group 对齐,以便它们在同一级别都匹配

enter image description here

#title {
  float: left;
  margin-left: 15px;
  padding-left: 15px;
  padding-top: 5px;
  font-size: 0.5vw;
  font-family: 'Armata';
  text-shadow: 0 0 80px rgba(255, 255, 255, 0.5);
  text-align: center;
}
<!-- This the table texts at the top -->

<table id="topTable" width="100%">
  <tr class="heading">
    <th width='1%'>ID</th>
    <th width='15%'>Name</th>
    <th width='5%'>Money</th>
    <th width='25%'>Job</th>
    <th width='15%'>Group</th>
    <th width='5%'>WP</th>
    <th width='5%'>Ping</th>
    <th width='1%'>Country</th>
  </tr>
</table>

<!-- This the pink table i want to align with the one at the top -->

<tr class="playersTable">
  <th width="5%">' ..playerID.. '</th>
  <th width="25%">' .. sanitize(name) .. '</th>
  <th width="15%">' .. (money) .. '</th>
  <th width="15%">' .. job .. '</th>
  <th width="15%">' .. group .. '</th>
  <th width="5%">' .. wantedLevel .. '</th>
  <th width="5%">' .. ping .. '</th>
  <th width="15%">' .. country .. '</th>
</tr>

我想摆脱这种宽度的东西,希望能自动做到,对不起,如果不清楚。

0 个答案:

没有答案