gpt4 book ai didi

php - 如何添加宽度以展开表格中的以下文本

转载 作者:行者123 更新时间:2023-11-28 00:30:56 24 4
gpt4 key购买 nike

我有下面的文字,我想知道是否有办法增加宽度,让桌面版占据我的大部分td单元格宽度?

我尝试添加一个宽度,但无法展开,但后来我将其设置为 white-space: wrap。如果我摆脱包装然后它确实有效但我无法让它分解到下一行:

这是我的代码:

<?php
include_once __DIR__. '/header2.php';

if(!isset($_SESSION['u_uid']))
{
header("Location: index.php?practice_diary_view=notlogin");
exit();
}
else
{
include_once __DIR__. '/includes/dbh.php';
$sql = "SELECT * FROM student_details WHERE id = ?;";

$stmt = mysqli_stmt_init($conn);

if (!mysqli_stmt_prepare($stmt, $sql))
{
echo "SQL error";
}
else
{
mysqli_stmt_bind_param($stmt, "i", $_SESSION['u_id']);
mysqli_stmt_execute($stmt);
$result = mysqli_stmt_get_result($stmt);

$row = mysqli_fetch_assoc($result);

$first_name = $row['first_name'];
$last_name = $row['last_name'];

$sql2 = "SELECT * FROM practice_diary WHERE first_name = ? AND last_name = ?;";

$stmt = mysqli_stmt_init($conn);

if (!mysqli_stmt_prepare($stmt, $sql2))
{
echo "SQL error";
}
else
{
mysqli_stmt_bind_param($stmt, "ss", $first_name, $last_name);
mysqli_stmt_execute($stmt);
$result2 = mysqli_stmt_get_result($stmt);
$resultCheck2 = mysqli_num_rows($result2);

if($resultCheck2 < 1)
{
echo '<div class="nopracticediaryview">There are no practice diary records associated with this user</div>';
exit();
}
else
{
echo '<table class="practice_diary_view">
<tr>
<th colspan="3" class="update_title">Welcome to the Practice Diary Viewing Section</th>
</tr>
<tr>';

while ($row2 = mysqli_fetch_assoc($result2))
{
echo '<tr>
<th>Username:</th><td>',htmlspecialchars($row2['user_uid']),'</td>
</tr>
<tr>
<th>First Name:</th><td>',htmlspecialchars($row2['first_name']),'</td>
</tr>
<tr>
<th>Last Name:</th><td>',htmlspecialchars($row2['last_name']),'</td>
</tr>
<tr>
<th>Lesson Title:</th><td>',htmlspecialchars($row2['lesson_title']),'</td>
</tr>
<tr>
<th>Describe Lesson:</th><td class="describe_lesson">',htmlspecialchars($row2['describe_lesson']),'</td>
</tr>
<tr>
<th>Hours of Practice:</th><td>',htmlspecialchars($row2['hours_practice']),'</td>
</tr>
<tr>
<th>Date of Practice:</th><td>',htmlspecialchars($row2['date_practice']),'</td>
</tr>';
}

echo '</table>';
}
}
}
}
?>

这是我的 CSS 代码:

.practice_diary_view .describe_lesson
{
white-space: nowrap;
font-size: 1em;
text-align: justify;
text-justify: inter-word;
line-height: 1.5em;
width: 5em;
height: 2em;
}

enter image description here

最佳答案

尝试将带有百分比的最小宽度添加到 TR 而不是 TD

关于php - 如何添加宽度以展开表格中的以下文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54415984/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com