html-table

How to scrape not well structured html tables with Beautifulsoup in Python?

依然范特西╮ 提交于 2020-04-14 10:02:31
问题 This website https://itportal.ogauthority.co.uk/information/well_data/lithostratigraphy_hierarchy/rptLithoStrat_1Page2.html seems have a not well organized html table. the only identifier of table cells are width inside each tr tag. I want to scrape the information of all 60 pages. How I can find a way to scrape each row of tables appropriately? I know the size of header is 10 columns but since for some tr tags, I have 5 td tags and for some other I have more or less td tags, it's not easy to

Table with white-space: nowrap and one column needs overflow: hidden

纵饮孤独 提交于 2020-04-13 05:02:08
问题 Here is my layout: body { font: 12px sans-serif; } #div1 { width: 750px; padding-top: 20px; padding-bottom: 20px; background-color: lime; } #table1 { background-color: white; } #table1 th, #table1 td { white-space: nowrap; } .class1 { background-color: pink; } /* all background colors are for testing */ <div id="div1"> <table id="table1"> <tr> <th>Name</th> <th>Col 1</th> <th>Col 2</th> <th>Fr<br/>10</th> <th>Sa<br/>11</th> <th>Su<br/>12</th> <th>Mo<br/>13</th> <th>Tu<br/>14</th> <th>We<br/

How to semantically code an HTML nested table that aligns (and associates) with its parent table's headers

烈酒焚心 提交于 2020-04-05 15:41:07
问题 Edit: The selected answer contains a link to the working fiddle I was able to compose without the use of a nested table. I want to semantically code a table in HTML with a layout like the picture below. Unfortunately I haven't been able to find anything quite like it here on the network. I have been able to force the look by manually setting cell widths, but I want to make sure the code I'm producing makes sense, and I don't think that's the case, because without manually setting the widths,

html tables: thead vs th

旧时模样 提交于 2020-03-30 06:49:21
问题 It looks like (according to the examples on this page, anyways) that if you're using THEAD, you don't need to use TH. Is that true? If so, what are the advantages/disadvantages of THEAD vs TH? 回答1: The <thead> tag is used to group the header content in an HTML table. The thead element should be used in conjunction with the tbody and tfoot elements. More : thead You use <thead> to encapsulate an entire row (or rows) to designate them as the Table Header. According to the spec, "This division

Creating table with javascript and add id and class to each td

孤街醉人 提交于 2020-03-23 08:52:07
问题 I'm trying to create a chess game in javascript. I created a chessboard and the next step is to add an id's and classes to created td's. Here is the code: <html> <head> <title> Play Chess! </title> <meta charset="utf-8"> <link rel='stylesheet' href='css/styles.scss' type='text/css'/> </head> <body> <script> var table =''; var rows =8; var cols=8; for (var r = 0; r<rows;r++){ table +='<tr>'; for(var c=0;c<cols;c++){ table+='<td>' +''+'</td>'; } table+='</tr>'; } document.write("<table border=1

How to loop multiple Table TH in AngularJS

佐手、 提交于 2020-03-04 20:36:49
问题 <table class="table table-bordered"> <thead> <tr> <th></th> <th colspan="3" ng-repeat="d in $ctrl.otherdata">{{d.name}}</th> </tr> <tr> <th>User ID</th> ***** want to loop following 3 th***** <th>ABC</th> <th>XYZ</th> <th>PQR</th> *************************************** </tr> </thead> <tbody> <tr ng-repeat="data in $ctrl.somedata"> <td>{{data.name}}</td> <td>{{data.x}}</td> <td>{{data.y}}</td> <td>{{data.z}}</td> </tr> </tbody> </table> Is it possible to loop following 3 th in ng-repeat based

HTML table to excel using JavaScript

浪尽此生 提交于 2020-03-04 05:55:09
问题 May i know how to press a button and download an excel(.xlsx), the excel will need to contain all the values. Some of the table is an input, need to download the input value. My html code look like this: <table id="tabledata" border=1> <tr><td>X</td><td>Y</td><td></td></tr> <tr><td class="tabledatacell"><input type="text" onkeyup="" id="dataX1"></td><td class="tabledatacell"><input type="text" onkeyup="" id="dataY1"></td><td><button onclick="remove(1)">Remove</button></td></tr> <tr><td class=

Alternative to pandas.read_html where ulr is not unique?

岁酱吖の 提交于 2020-03-04 05:04:59
问题 I want to access data from an html table from the section "ERGEBNIS" with python 3.7. The problem is, that the results for each combination of the drop down values are only shown after clicking on submit. This does however not change the url, so that I have no idea how I can access the results table after updating the input values of the drop downs. Here is what I've done so far: from selenium import webdriver from selenium.webdriver.support.ui import Select import time browser.get('https:/

How to change classes like schedule in html calendar tables

半世苍凉 提交于 2020-03-01 04:10:40
问题 I have calendar like html tables.like <td id="1">1</td> <td id="2">2</td> <td id="3">3</td> <td id="4">4</td> <td id="5">5</td> <td id="6">6</td> <td id="7">7</td> <td id="8">8</td> <td id="9">9</td> I would like to change its classes like calendar schedule, if I clicked cell 2 ,forward 3day's classes are changed.(I attached images) ①Are there any good way to realize it? ②Are there any other ways to realize schedule like expression(result image is illustrated below), except for like applying

How to change classes like schedule in html calendar tables

倾然丶 夕夏残阳落幕 提交于 2020-03-01 04:07:09
问题 I have calendar like html tables.like <td id="1">1</td> <td id="2">2</td> <td id="3">3</td> <td id="4">4</td> <td id="5">5</td> <td id="6">6</td> <td id="7">7</td> <td id="8">8</td> <td id="9">9</td> I would like to change its classes like calendar schedule, if I clicked cell 2 ,forward 3day's classes are changed.(I attached images) ①Are there any good way to realize it? ②Are there any other ways to realize schedule like expression(result image is illustrated below), except for like applying