Skip to content

Add id to table rows by using table id and row id #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions inline-gdocs-viewer.php
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ private function dataToHtml ($r, $options, $caption = '') {

$html .= "<thead>\n";
foreach ( $thead as $v ) {
$html .= "<tr class=\"row-$ir " . $this->evenOrOdd( $ir ) . "\">";
$html .= "<tr id=\"" . esc_attr( $id ) . "-row-$ir\" class=\"row-$ir " . $this->evenOrOdd( $ir ) . "\">";
$ir++;
$ic = 1; // reset column counting
foreach ( $v as $th ) {
Expand All @@ -628,7 +628,7 @@ private function dataToHtml ($r, $options, $caption = '') {
if ( $tfoot ) {
$html .= "<tfoot>\n";
foreach ( $tfoot as $v ) {
$html .= "<tr class=\"row-$ir " . $this->evenOrOdd( $ir ) . "\">";
$html .= "<tr id=\"" . esc_attr( $id ) . "-row-$ir\" class=\"row-$ir " . $this->evenOrOdd( $ir ) . "\">";
$ir++;
$ic = 1; // reset column counting
foreach ( $v as $td ) {
Expand All @@ -644,7 +644,7 @@ private function dataToHtml ($r, $options, $caption = '') {

$html .= "<tbody>\n";
foreach ( $tbody as $v ) {
$html .= "<tr class=\"row-$ir " . $this->evenOrOdd( $ir ) . "\">";
$html .= "<tr id=\"" . esc_attr( $id ) . "-row-$ir\" class=\"row-$ir " . $this->evenOrOdd( $ir ) . "\">";
$ir++;
$ic = 1; // reset column counting
foreach ( $v as $td ) {
Expand Down