M
M
margarittapizza2019-11-22 14:51:25
PHP
margarittapizza, 2019-11-22 14:51:25

How to output data from an Excel table to an HTML table on a website?

The client asks to output data from an Excel table to a table on the site.
For this to happen automatically.
The site is powered by 1C-Bitrix.
Are there any solutions to such a problem?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
idShura, 2019-11-22
@idShura

There is a solution, you need to pay money to a professional who will do everything.

A
Anton, 2019-11-22
@anton99zel

What is an Excel table?
This is a data set received from the database, so according to the idea, you need to take this data and output
an example in a html layout in a loop:

spoiler
<?php
$marks = array(
    array(
        'name'=>'Петров',
        'subjects'=>array(
            'math'=>4,
            'physics'=>3,
            'chemistry'=>3,
            'russian'=>5
        ),
    ),
    array(
        'name'=>'Иванов',
        'subjects'=>array(
            'math'=>4,
            'physics'=>5,
            'chemistry'=>4,
            'russian'=>5
        ),
    ),
       array(
        'name'=>'Сидоров',
        'subjects'=>array(
            'math'=>5,
            'physics'=>3,
            'chemistry'=>4,
            'russian'=>3
        ),
    ),
       array(
        'name'=>'Ветрова',
        'subjects'=>array(
            'math'=>2,
            'physics'=>3,
            'chemistry'=>3,
            'russian'=>4
        ),
    ),
       array('name'=>'Филатова',
        'subjects'=>array(
            'math'=>4,
            'physics'=>4,
            'chemistry'=>4,
            'russian'=>5
        ),
    ),
       array(
        'name'=>'Бубнов',
        'subjects'=>array(
            'math'=>4,
            'physics'=>3,
            'chemistry'=>3,
            'russian'=>4
        ),
    ),
       array(
        'name'=>'Пескова',
        'subjects'=>array(
            'math'=>5,
            'physics'=>5,
            'chemistry'=>4,
            'russian'=>2
        ),
    ),
       array(
        'name'=>'Ленинов',
        'subjects'=>array(
            'math'=>4,
            'physics'=>3,
            'chemistry'=>3,
            'russian'=>5
        ),
    ),
);
 
?>
<table>
    <thead>
<tr>
        <td>ФИО / Предметы</td>
        <td>математика</td>
        <td>физика</td>
        <td>химия</td>
        <td>русский</td>
        <td>средний бал</td>
</tr>
    </thead>
    <tbody>
<?php
foreach ($marks as $student)
{
    echo '<tr>
             <td>'.$student['name'].'</td>
             <td>'.$student['subjects']['math'].'</td>
             <td>'.$student['subjects']['physics'].'</td>
             <td>'.$student['subjects']['chemistry'].'</td>
             <td>'.$student['subjects']['russian'].'</td>
             <td>'.(($student['subjects']['math']+$student['subjects']['physics']+$student['subjects']['chemistry']+$student['subjects']['russian'])/4).'</td>
    </tr>';
}
?>
    </tbody>
</table>

L
Lord_Dantes, 2019-11-22
@Lord_Dantes

https://codebeautify.org/excel-to-html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question