我的.aspx页中有一个表格,我想使其变得流畅。我的其他布局很流畅,但是桌子始终保持原样。 CSS是

#reportingEmployee
{
font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
width:100%;
border-collapse:collapse;
}
#reportingEmployee td, #reportingEmployee th
{
font-size:1em;
    border: 1px solid #ff0000;/* #98bf21;*/
padding:3px 7px 2px 7px;
}
#reportingEmployee th
{
font-size:1.1em;
text-align:left;
padding-top:5px;
padding-bottom:4px;
    background-color: #ef0909;/*#A7C942;*/
color:#ffffff;
}
#reportingEmployee tr.alt td
{
color:#000000;
background-color:#EAF2D3;
}


HTML是


                            
                                
                                    雇员的名字
                                
                                
                                    日期
                                
                                
                                    时间到
                                
                                
                                    暂停
                                
                                
                                    迟到
                                
                                
                                    提早出发
                                
                                
                                    缺席
                                
                            
                            
                                
                                    比拉尔
                                
                                
                                    25-11-2013
                                
                                
                                    10:00
                                
                                
                                    20:00
                                
                                
                                    
                                        
                                    
                                
                                
                                    
                                        
                                    
                                
                                
                                    
                                        
                                    
                                
                            

                         <tr class="alt">
                            <td>
                                Bilal
                            </td>
                            <td>
                                25-11-2013
                            </td>
                            <td>
                                10:00
                            </td>
                            <td>
                                20:00
                            </td>
                            <td>
                                <center>
                                    <img src="../img/tick.png" />
                                </center>
                            </td>
                            <td>
                                <center>


            <img src="../img/cross.png" />
                            </center>
                        </td>
                        <td>
                            <center>
                                <img src="../img/cross.png" />
                            </center>
                        </td>
                    </tr>
                </table>

最佳答案

尝试在列中添加基于%的with:

#reportingEmployee td, #reportingEmployee th
{
font-size:1em;
    border: 1px solid #ff0000;/* #98bf21;*/
    padding:3px 7px 2px 7px;
    width:14%;
}

关于css - 如何使 table 变得流畅,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/20187745/

10-09 21:23