我有一张表,我在每行的末尾打印一个按钮。我希望这个按钮很小。
尽管使用溢出省略号,但在打印表格时,我的文本不会被截断。我不想要水平滚动条。
我的表格标题栏,当我向下滚动时,最上面一行总是隐藏。
非常感谢任何帮助。这是我的 CSS 脚本https://jsfiddle.net/v6sahfyc/1/
编辑:在这里添加php代码:
// <?php
// echo "<div id='awesometable'>";
// ?>
<!-- <CAPTION>RESERVATION TABLE</CAPTION> -->
<?php
echo "<br><br><p style=\"font-family:verdana; font-size:100%; margin-left: 5em;\"><i><strong>Reservation Table.</strong></i></p>";
echo "<table id='reservation' class='inlineTable'>"; //style='border: solid 1px black;'
//echo "<thead>";
echo "<tr>";
echo "<th class=\"row-1 uid\">UserId</th>";
echo "<th class=\"row-2 rname\">Resource <br> Name</th>";
echo "<th class=\"row-3 rtype\">Resource <br> Type</th>";
echo "<th class=\"row-4 rloc\">Resource <br> Location</th>";
echo "<th class=\"row-5 treq\">Time <br> Required </th>";
echo "<th class=\"row-6 REM\">Delete? </th>";
echo "</tr>";
//echo "</thead>\n";
//echo "<col = width: 3em />";
?>
<?php
$username = "root";
$password = "";
$host = "localhost";
$connector = mysql_connect($host,$username,$password) or die("Unable to connect");
$selected = mysql_select_db("mydb", $connector) or die("Unable to connect");
$selectSQL = "SELECT user_ID, ResourceName, ResourceType, ResourceLocation, ReservationTime FROM reservation_table";
if( !( $selectRes = mysql_query( $selectSQL ) ) ){
echo 'Retrieval of data from Database Failed - #'.mysql_errno().': '.mysql_error();
}else{
?>
<tbody>
<?php
if( mysql_num_rows( $selectRes )==0 ){
}else{
while( $row = mysql_fetch_assoc( $selectRes ) ){
echo "<tr><td>{$row['user_ID']}</td><td>{$row['ResourceName']}</td><td>{$row['ResourceType']}</td><td>{$row['ResourceLocation']}</td><td>{$row['ReservationTime']}</td>";
$active = $_SESSION['usr'] == $row['user_ID'];
echo "<td>"."<button class='btn' type='submit' id='1'".($active ? "" : "disabled").">"."Delete"."</button>"."</td>";
}
}
?>
</tbody>
</table>
<?php
mysql_close($connector);
}
?>