javascript - 无法覆盖引导列宽限制
问题描述
我正在尝试制作一个在页面上显示信息的表格。我不希望文本换行。我已经做了很多搜索,但我似乎无法修复它!我正在使用引导程序,但我不知道如何覆盖这里发生的任何类型的限制。请帮忙!
网页的 HTML/PHP
<?php
function createTable(){
$maxDays=date('t'); //gets the number of days in a month
$currentDayOfMonth=date('j'); //gets the current day
$rows = 14; // define number of rows
$cols = $maxDays;// define number of columns
// loops through and creates the table
for($tr=1;$tr<=$rows;$tr++){
echo "<tr>";
for($td=1;$td<=$cols;$td++){
echo "<td class='tableCells'>654 kwh</td>";
}
echo "</tr>";
}
}
function writeDays(){
$lastDayUTS = mktime (0, 0, 0, date("m"), date('t'), date("Y"));
$lastDay = date("d", $lastDayUTS);
$monthName = date("M", $lastDayUTS);
//writes the days above the table
for($n=1;$n <= $lastDay;$n++){
echo "<th>$monthName $n</th>";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BmbxuPwQa2lc/FVzBcNJ7UAyJxM6wuqIj61tLrc4wSX0szH/Ev+nYRRuWlolflfl" crossorigin="anonymous">
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-lg-9">
<table class='table table-hover'>
<thead>
<!-- writes the days above the table -->
<?php writeDays(); ?>
</thead>
<tbody>
<?php
// loops through and puts values into the table
createTable();
?>
</tbody>
</table>
</div>
</div>
</div>
</body>
</html>
最终目标是将其嵌入页面并溢出 x 轴,以便您可以水平滚动。我希望文本都在一行上(不换行)。任何帮助是极大的赞赏!!!
解决方案
推荐阅读
- c# - 网格远程数据的 blazor telerik 虚拟化
- javascript - jQuery cookie 过期时间不正确
- python - 为什么 Beautifulsoup 在下载网页时会出现奇怪的源代码字符?
- c - *variable !=0 是什么意思?
- python - 烧瓶 SQLAlchemy 对象中的默认 unix 时间值
- c# - .Net core 3:Microsoft.Extensions.Logging.Internal 中不存在命名空间 internal
- node.js - Angular with node.js http失败响应未知url):0未知错误
- java - 如何使用 SXSSF Streaming api 编辑现有的大型 excel 文件
- android - 杀死应用程序后我的工作经理不工作
- reactjs - React Hot Reloading + Webpack 没有 Express 或 Webpack-Dev-Server